#include<bits/stdc++.h>

using namespace std;
using ll=long long;
const int MOD = 1000000007;

int main() {
    int n;
    ll F[1000 + 1] = {0};
    F[1] = F[2] = 1;
    F[3] = 2;
    for (int i = 4; i <= 1000; i++) {
        F[i] = (F[i - 1] + F[i - 3]) % MOD;
    }
    while (cin >> n) {
        cout << F[n] << endl;
    }

    return 0;
}